<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>CalcHelper Demo</title>
    <script type="text/javascript" src="http://libs.baidu.com/jquery/1.9.1/jquery.js"></script>
    <script type="text/javascript" src="CalcHelper.js"></script>
    <script type="text/javascript">
        $(function(){
            $("#btn").click(function(){
                calcHelper.SetFixed(3);
                var num1 = $("#num1").val();
                var num2 = $("#num2").val();
                var symbol = $("#symbol").val();
                switch(symbol){
                    case "+":
                        $("#result").text(calcHelper.Addition(num1,num2));
                        break;
                    case "-":
                        $("#result").text(calcHelper.Subtraction(num1,num2));
                        break;
                    case "×":
                        $("#result").text(calcHelper.Multiplication(num1,num2));
                        break;
                    case "÷":
                        $("#result").text(calcHelper.Division(num1,num2));
                        break;
                }
            });
        })
    </script>
</head>
<body>
    <input type="text" id="num1" value="0" />
    <select id="symbol">
        <option value ="+" selected="selected">+</option>
        <option value ="-">-</option>
        <option value ="×">×</option>
        <option value ="÷">÷</option>
    </select>
    <input type="text" id="num2" value="0" />
    <span>=</span>
    <span id="result">0</span>
    <input type="button" id="btn" value="计算" />
</body>
</html>